package com.xiu.travel.entity;

import com.xiu.travel.enums.SexEnum;
import com.xiu.travel.enums.UserSourceEnum;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Date;

/**
 * <p>
 * 会员表
 * </p>
 *
 * @author YuLing
 * @since 2023-10-13
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)

@TableName("ums_member")
@Schema(name = "UmsMember对象", description = "会员表")
public class UmsMember implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @Schema(description = "创建者", hidden = true)
    @TableField(fill = FieldFill.INSERT)
    protected Long creator;
    @Schema(description = "修改者", hidden = true)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected Long updater;
    @TableLogic
    @Schema(description = "删除标志", hidden = true)
    protected Integer deleted;
    /**
     *
     */
    @Schema(name = "id", description = "")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     *
     */
    @Schema(name = "member_level_id", description = "")
    @TableField("member_level_id")
    private Long memberLevelId;
    /**
     *
     */
    @Schema(name = "username", description = "")
    @TableField("username")
    private String username;
    /**
     * 支付码
     */
    @Schema(name = "payCode", description = "支付码")
    @TableField("pay_code")
    private String payCode;
    /**
     *
     */
    @Schema(name = "password", description = "")
    @TableField("password")
    private String password;
    /**
     *
     */
    @Schema(name = "mail", description = "")
    @TableField("mail")
    private String mail;
    /**
     *
     */
    @Schema(name = "nickname", description = "")
    @TableField("nickname")
    private String nickname;
    /**
     *
     */
    @Schema(name = "phone", description = "")
    @TableField("phone")
    private String phone;
    /**
     *
     */
    @Schema(name = "icon", description = "")
    @TableField("icon")
    private String icon;
    /**
     * 性别：0->未知；1->男；2->女
     */
    @Schema(name = "gender", description = "性别：0->未知；1->男；2->女")
    @TableField("gender")
    private SexEnum gender;
    /**
     * 生日
     */
    @Schema(name = "birthday", description = "生日")
    @TableField("birthday")
    private LocalDate birthday;
    /**
     *
     */
    @Schema(name = "city", description = "")
    @TableField("city")
    private String city;
    /**
     *
     */
    @Schema(name = "job", description = "")
    @TableField("job")
    private String job;
    /**
     *
     */
    @Schema(name = "personalized_signature", description = "")
    @TableField("personalized_signature")
    private String personalizedSignature;
    /**
     * 用户来源
     */
    @Schema(name = "source_type", description = "用户来源")
    @TableField("source_type")
    private UserSourceEnum sourceType;
    /**
     * 积分
     */
    @Schema(name = "integration", description = "积分")
    @TableField("integration")
    private Integer integration;
    /**
     * 成长值
     */
    @Schema(name = "growth", description = "成长值")
    @TableField("growth")
    private Integer growth;
    /**
     * 剩余抽奖次数
     */
    @Schema(name = "lucky_count", description = "剩余抽奖次数")
    @TableField("lucky_count")
    private Integer luckyCount;
    /**
     * 历史积分数量
     */
    @Schema(name = "history_integration", description = "历史积分数量")
    @TableField("history_integration")
    private Integer historyIntegration;
    /**
     *
     */
    @Schema(name = "third_type", description = "")
    @TableField("third_type")
    private String thirdType;
    /**
     *
     */
    @Schema(name = "third_key", description = "")
    @TableField("third_key")
    private String thirdKey;
    /**
     * 支付平台用户ID
     */
    @Schema(name = "open_id", description = "")
    @TableField("open_id")
    private String openId;
    @Schema(description = "创建时间", hidden = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
    @Schema(description = "修改时间", hidden = true)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    @Schema(description = "状态", hidden = true)
    private Integer status;
    @Version
    @Schema(description = "乐观锁", hidden = true)
    private Integer version;


}
